package com.shd.edanpei.presenter;

import com.shd.edanpei.base.BasePresenterImpl;
import com.shd.edanpei.base.network.api.ApiCreator;
import com.shd.edanpei.base.network.rx.BaseObserver;
import com.shd.edanpei.base.network.rx.RxTransformer;
import com.shd.edanpei.bean.ScoreModel;
import com.shd.edanpei.presenter.contract.WithdrawContract;

import io.reactivex.android.schedulers.AndroidSchedulers;

/**
 * Created by mc on 2018/4/4.
 * yang-wen-wen
 */

public class WithdrawPresenter extends BasePresenterImpl<WithdrawContract.WithdrawIView>
        implements WithdrawContract.WithdrawIPresenter {

    public WithdrawPresenter(WithdrawContract.WithdrawIView mView) {
        super(mView);
    }


    @Override
    public void getData() {
        ApiCreator.getApi().integeral()
                .compose(RxTransformer.<ScoreModel>errorHandle())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<ScoreModel>() {
                    @Override
                    protected void onSuccess(ScoreModel data) {
                        mBaseIView.setData(data);
                    }
                });
    }
}
